<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            /*超链接不受继承影响,本身自带颜色*/
            color: red;
        }
        /*优先级,div是间接选择,而p是直接选中,优先级更高*/
        p{
            /*提升当前样式的优先级为最高*/
            color: blue !important;
        }
        /*id选择器优先级最高,范围越小优先级越高*/
        #p1{
            color: green;
        }


    </style>





</head>
<body>
<p id="p1">p1</p>
<div>
    div
    <p>p2</p>
    <span>span</span>
    <a href="">超链接</a>
</div>
</body>
</html>